hdparm: Fix LDFLAGS
authorRosen Penev <[email protected]>
Tue, 22 Jan 2019 05:34:37 +0000 (21:34 -0800)
committerRosen Penev <[email protected]>
Tue, 22 Jan 2019 05:38:57 +0000 (21:38 -0800)
Based on debian patch. LDFLAGS were not being passed, which caused relro
to not be applies.

Also made stock CFLAGS optional. -fkeep-inline was keeping sizes high.

Removed PKG_NO_MIPS16 as the original problem seems to be gone.

Size from 54338 to 50761

Signed-off-by: Rosen Penev <[email protected]>
utils/hdparm/Makefile
utils/hdparm/patches/010-ldflags.patch [new file with mode: 0644]

index e095af4adc1665a2fe6f9dcbe0d83970ca1f4afb..78b7b990652ca305c2daedad08c9ad5322df53b6 100644 (file)
@@ -10,7 +10,6 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=hdparm
 PKG_VERSION:=9.58
 PKG_RELEASE:=1
-PKG_USE_MIPS16:=0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
@@ -21,8 +20,6 @@ PKG_LICENSE:=BSD-Style Open Source License
 
 include $(INCLUDE_DIR)/package.mk
 
-TARGET_CFLAGS+=-D_GNU_SOURCE
-
 define Package/hdparm
   SECTION:=utils
   CATEGORY:=Utilities
diff --git a/utils/hdparm/patches/010-ldflags.patch b/utils/hdparm/patches/010-ldflags.patch
new file mode 100644 (file)
index 0000000..e477874
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/Makefile
++++ b/Makefile
+@@ -13,9 +13,8 @@ oldmandir = $(manprefix)/man
+ CC ?= gcc
+ STRIP ?= strip
+-CFLAGS := -O2 -W -Wall -Wbad-function-cast -Wcast-align -Wpointer-arith -Wcast-qual -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -fkeep-inline-functions -Wwrite-strings -Waggregate-return -Wnested-externs -Wtrigraphs $(CFLAGS)
++CFLAGS ?= -O2 -W -Wall -Wbad-function-cast -Wcast-align -Wpointer-arith -Wcast-qual -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -fkeep-inline-functions -Wwrite-strings -Waggregate-return -Wnested-externs -Wtrigraphs $(CFLAGS)
+-LDFLAGS = -s
+ #LDFLAGS = -s -static
+ INSTALL = install
+ INSTALL_DATA = $(INSTALL) -m 644